package cc.rengu.redp.flowable.service;

import cc.rengu.redp.common.domain.QueryRequest;
import cc.rengu.redp.common.exception.RedpException;
import cc.rengu.redp.flowable.domain.ProcessDesignVo;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.Map;

public interface ProcessDesignService {

    /**
     *
     * @param processDesignVo processDesignVo
     * @param queryRequest  queryRequest
     * @return  IPage
     */
    IPage<ProcessDesignVo> procDesignList(ProcessDesignVo processDesignVo, QueryRequest queryRequest) throws Exception;

    /**
     * 流程定义删除
     * @param modelId 流程定义Id
     */
    void deleteProcDesign(String modelId) throws RedpException;


    /**
     * 保存流程定义
     * @param editorJson
     */
    void saveFlowDesign(String editorJson) throws RedpException;

    /**
     * 获取流程定义
     * @param modelId
     * @return
     */
    String getFlowDesignDesign(String modelId);

    /**
     * 复制流程定义
     * @param modelId
     */
    void copyFlowDesign(String modelId);

    /**
     * 流程部署
     */
    void deployProcDesign(String modelId) throws RedpException, Exception;

    /**
     * 流程配置-列出流程中所有节点
     */
    Map<String, Object> listProcessAllNodes(String modelId) throws Exception;

    /**
     * 获取流程设计图
     * @param modelId
     * @return base64 图片数据
     */
    String getFlowImage(String modelId) throws RedpException;

    /**
     * 挂起已发布流程
     * @param modelId
     */
    void suspendDeployment(String modelId, Boolean allCurrentActiveInstances) throws RedpException;

    /**
     * 激活已挂起的发布流程
     * @param modelId
     * @param allCurrentActiveInstances
     */
    void activeDeployment(String modelId, Boolean allCurrentActiveInstances) throws RedpException;
}
